import { defineComponent } from '@vue/composition-api'
import moment from 'moment'

import './style.styl'

export const Panel = defineComponent({
  props: {
    time: String
  },
  setup(props, context) {
    return () => (
      <div class='panel' onClick={e => context.emit('click', e)}>
        <p>{context.slots.default()}</p>
        <p>{context.slots.storng()}</p>
        <p>
          时间：{moment(props.time).format('yyyy-MM-dd A HH:mm:ss')} 距离现在是: {moment(props.time).toNow()}
        </p>
      </div>
    )
  }
})

export default Panel
